package wms2010.gui.views.ageClass;

import java.util.Collections;
import java.util.List;

import javax.swing.table.AbstractTableModel;

import wms2010.model.controller.model.AgeClass;

public class AgeClassViewTableModel extends AbstractTableModel {
	private List<AgeClass> ageClasses = Collections.EMPTY_LIST;

	public List<AgeClass> getAgeClasses() {
		return ageClasses;
	}

	public void setAgeClasses(List<AgeClass> ageClasses) {
		this.ageClasses = ageClasses;
	}

	public String getColumnName(int col) {
		switch (col) {
		case 0:
			return "Name";
		default:
			return "";
		}
	}

	public int getColumnCount() {
		return 2;
	}

	public int getRowCount() {
		return ageClasses.size();
	}

	public Object getValueAt(int arg0, int arg1) {
		AgeClass ageClass = ageClasses.get(arg0);
		switch (arg1) {
		case 0:
			return ageClass.getName();
		default:
			return "";
		}
	}

}
